// vue.config.js
const path = require('path')

module.exports = {
    publicPath: '/',
    lintOnSave: 'default', // 是否开启eslint检测,false不开启，有效值：true || false || default
    productionSourceMap: false, // 生成环境下面开启sourceMap支持断点调试
    pluginOptions: {
        'style-resources-loader': {
            preProcessor: 'less',
            patterns: [
                // 全局less变量存储路径
                path.resolve(__dirname, './src/App.less'),
            ]
        }
    },
    devServer: {
        host: '0.0.0.0',
        port: 3303,
        open: true,
        proxy: {
            // detail: https://cli.vuejs.org/config/#devserver-proxy
            ['/pro-api']: {
                target: 'http://119.45.199.238:57002/md-api',
                changeOrigin: true,
                pathRewrite: {
                    ['^/pro-api']: ''
                }
            },
            ['/dev-api']: {
                target: 'http://192.168.1.4:5802/md-api',
                changeOrigin: true,
                pathRewrite: {
                    ['^/dev-api']: ''
                }
            }
        },
        disableHostCheck: true
    }
}